<template>
   <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus @keyup.enter="add" v-model.trim="name"/>
    </header>
</template>

<script>
export default {
  data() {
    return {
      name:''
    }
  },
  props: ['list'],
  methods: {
    add() {
      console.log(1);
        this.$emit('add',this.name)
      }
     }
}
</script>

<style>

</style>